package com.designpatterns.behavioral.bridge;

import cn.hutool.core.util.ReflectUtil;
import com.designpatterns.utils.YMLUtil;

public class Client {
    public static void main(String[] args) {
        String path = "C:\\Users\\32674\\IdeaProject\\design-partterns\\src\\main\\jav" +
                "a\\com\\designpatterns\\behavioral\\bridge\\config.yml";
        Object imageRef = YMLUtil.getValue(path, "image.ref");
        Object osRef = YMLUtil.getValue(path, "os.ref");
        Image image = (Image)ReflectUtil.newInstance(imageRef.toString());
        ImageImp os = (ImageImp)ReflectUtil.newInstance(osRef.toString());
        image.setImp(os);
        image.parseFile("小龙女");
    }
}
